<template>
  <div class="report-box">
    <iframe
      id="fram_box"
      :src="`${reportSrc}`"
      width="100%"
      frameborder="0"
      scrolling="no"
      style="height:90vh"
    ></iframe>
  </div>
</template>

<script>

export default {
  name: "report",
  components: {},
  computed: {
    reportSrc() {
      if (!process.env.VUE_APP_REPORT_API) {
        return;
      }
      return process.env.VUE_APP_REPORT_API + '/#/report/report';
    },
  },
  created() {
    window.parent.postMessage({
        // url: 'http://localhost:9527',
        url: process.env.VUE_APP_BASE_API,
        isShow: 'no',
      },'*')
  },
  methods: {
    // iframe加载完成后的回调函数
    loadFrameFn() {
      let data = {
        url: 'http://localhost:9527',
        isShow: 'no',
      }
      // 获取iframe节点
      const iframeBox = document.getElementById('fram_box')
      // iframeBox.contentWindow.postMessage(data,'*');
      // console.log(iframeBox,'iframeBox');
      // 192.168.150.128:9528
      // 192.168.137.13:9091
    },
  }
};
</script>
<style scoped></style>
